package com.py.korona.db.model.base;

import java.util.ArrayList;
import java.util.Collection;

public class EntityDescription {
    private Collection<EntityProperty> properties = null;

    public void addProperty(EntityProperty property) {
        if (properties == null) {
            properties = new ArrayList<EntityProperty>();
        }
        properties.add(property);
    }

    public Collection<EntityProperty> properties() {
        return properties;
    }

    public String[] propertyNames() {
        String[] result = null;
        result = new String[properties.size()];
        int index = 0;
        for (EntityProperty column : properties) {
            result[index] = column.getName();
            index++;
        }
        return result;
    }
}
